package com.example.myapplication.model.db.dao;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;

import com.example.myapplication.model.entity.Forum;
import com.example.myapplication.model.entity.ForumPics;
import com.example.myapplication.model.entity.NewsComment;
import com.example.myapplication.model.entity.User;

import java.util.List;


@Dao
public interface ForumDao {
    //插入评论或回复
    @Insert
    public void insertForum(Forum... forums);
    //查找所有的评论或回复
    @Query("SELECT * FROM Forum")
    public List<Forum> findByAllForum();
    //按照标题查找评论或回复
    @Query("SELECT * FROM Forum where forumTitle == :title")
    public Forum findByTitleForum(String title);
    //更新评论或回复
    @Update
    public void updateForum(Forum... forum);
    //删除评论或回复
    @Delete
    public void deleteForum(Forum... forums);



}
